﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using YunCMS.Common;
using YunCMS.Core;
using YunCMS.Core.Configration;

public partial class ConfigSetting : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        string path = Server.MapPath(@"configs\site.config");
        XmlControl doc = new XmlControl(path);
        doc.Delete("/siteconfig/NewNode");
        doc.RemoveAll("/siteconfig/Daniel");
        doc.Replace("/siteconfig/watermark", "images");
        doc.InsertNode("/siteconfig", "Daniel1", "Child", "11111111111");
        doc.InsertElement("/siteconfig", "Daniel2", "Child", null, null);
        doc.Save();      
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        SiteConfig conf = new SiteConfig();
        conf.Copyright = "asdasdals";
        conf.Company = "Yun Studio";
        JScript.Alert(conf.Company, this);
        JScript.Alert(conf.Company, this);
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        SiteConfig conf = new SiteConfig();
        conf.Copyright = "asdasdals";
        conf.Company = "Yun Studio";
        conf.Description = "This is a new cms for Yun studio, version 1.0";
        LogUtil.WriteConsoleLog("This is a new cms for Yun studio, version 1.0");
        LogUtil.WriteLog("This is a new cms for Yun studio, version 1.0");
        JScript.Alert("Yun Studio", this);
        conf.Save();
    }
}